﻿using System;
using Abp.Domain.Entities.Auditing;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using FwProject.Authorization.Users;
using System.Collections.Generic;
using FwProject.Core.FactoryInfo;

namespace FwProject.Core.Restaurant
{
    /// <summary>
    /// 餐厅信息
    /// </summary>
    [Table("RestaurantInfo")]
    public class RestaurantInfo : FullAuditedEntity<Guid>
    {
        public const int StringLength = 200;
        public const string SavePath = @"/RestaurantInfo/Image/";

        public const string TempFileUrlPrefix = FwConsts.TempFileUrlPrefix + "restaurantInfo/";
        public const string SaveFileUrlPrefix = FwConsts.SaveFileUrlPrefix + "restaurantInfo/";

        public const string SaveFileUrlExcelPrefix = FwConsts.SaveFileUrlPrefix + "restaurantInfo/Excel/";

        /// <summary>
        /// 工厂
        /// </summary>
        public Guid? FactoryinfoId { get; set; }


        [Required]
        [StringLength(StringLength)]
        /// <summary>
        /// 餐厅地址
        /// </summary>
        /// <value>The restaurant address.</value>
        public string RestaurantAddress { get; set; }
        [Required]
        [StringLength(StringLength)]
        /// <summary>
        /// 餐厅名称
        /// </summary>
        /// <value>The name of the restaurant.</value>
        public string RestaurantName { get; set; }
        [Required]
        [StringLength(StringLength)]
        /// <summary>
        /// 经度
        /// </summary>
        /// <value>The longitude.</value>
        public string longitude { get; set; }
        [Required]
        [StringLength(StringLength)]
        /// <summary>
        /// 纬度
        /// </summary>
        /// <value>The latitude.</value>
        public string latitude { get; set; }
        /// <summary>
        /// 餐厅绑定司机
        /// </summary>
        /// <value>The employee driverid.</value>
        public long EmployeeDriverid { get; set; }
        [ForeignKey("EmployeeDriverid")]
        /// <summary>
        /// 司机对象
        /// </summary>
        /// <value>The employee driver.</value>
        public virtual User EmployeeDriver { get; set; }
        /// <summary>
        /// 拼音首字母
        /// </summary>
        /// <value>The character.</value>
        public string Character { get; set; }
        /// <summary>
        /// 餐厅logo 图片
        /// </summary>
        /// <value>The thump.</value>
        public string Thump { get; set; }
        /// <summary>
        /// 餐厅对应的型号
        /// </summary>
        /// <value>The loading car info.</value>
        public ICollection<RestaurantTypenNumberInfo> RestaurantTypenNumberInfos { get; set;}
        /// <summary>
        /// 收费方式
        /// </summary>
        public ChargeWayEnum ChargeWay { get; set; } = ChargeWayEnum.按套收费;
        /// <summary>
        /// 结算方式
        /// </summary>
        public BalanceWayEnum BalanceWay { get; set; } = BalanceWayEnum.定期结算;
        /// <summary>
        /// 结算周期
        /// </summary>
        public BalanceCycleEnum BalanceCycle { get; set; } = BalanceCycleEnum.每月定期;
        /// <summary>
        /// 是否停用
        /// </summary>
        public bool IsDiscontinuation { get; set; } = false;

        public DateTime? DiscontinuationTime { get; set; }
        /// <summary>
        /// 期初店存
        /// </summary>
        public int Stock { get; set; } = 0;
        /// <summary>
        /// 实际店存
        /// </summary>
        public int RealStock { get; set; } = 0;
        /// <summary>
        /// 更新店存时间
        /// </summary>
        public DateTime? StockTime { get; set; }

        /// <summary>
        /// 收取押金
        /// </summary>
        public decimal Deposit { get; set; } = 0;
        /// <summary>
        /// 押金收取日期
        /// </summary>
        public DateTime? DepositDate{ get; set; }
        /// <summary>
        /// 餐厅联系人
        /// </summary>
        public string RestaurantContact { get; set; }
        /// <summary>
        /// 联系电话
        /// </summary>
        public string Mobile { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string RemarkContent { get; set; }
    }
    /// <summary>
    /// 收费方式类型
    /// </summary>
    public enum ChargeWayEnum {
        [Display(Name = "按套收费")]
        按套收费=0,
        [Display(Name = "按箱收费")]
        按箱收费 =1
    }
    /// <summary>
    /// 结算方式类型
    /// </summary>
    public enum BalanceWayEnum {
        [Display(Name = "日结")]
        日结 =0,
        [Display(Name = "定期结算")]
        定期结算 =1
    }
    /// <summary>
    /// 结算周期类型
    /// </summary>
    public enum BalanceCycleEnum {
        [Display(Name = "每周定期")]
        每周定期 =0,
        [Display(Name = "半月定期")]
        半月定期 =1,
        [Display(Name = "每月定期")]
        每月定期 =2,
        [Display(Name = "自定日期")]
        自定日期 =3
    }
}
